let fs = require("fs");

const readFile = function(fileName){
    return new Promise((resolve,reject)=>{
        fs.readFile(fileName,function(err,data){
            if(err) reject(err);

            resolve(data.toString());
        })
    })
}

readFile("./README.md")
.then(console.log)
.catch(console.error)